/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package util;

/**
 *
 * @author NATHAN
 */
public class EMISUtil {

  /**
   * Helper method to convert phone ########## to (###) ###-####
   * @param index index of the phone number in the phoneList
   * @return Converted string
   */
  public static String convertPhoneString(String number) {
    StringBuilder sb = new StringBuilder(number);
    sb.insert(0, '(');
    sb.insert(4, ')');
    sb.insert(5, " ");
    sb.insert(9, '-');
    return sb.toString();
  }

  /**
   * Helper method to convert ssn ######### to ###-##-####
   * @return Converted string
   */
  public static String convertSsnString(int ssn) {
    //error check to make sure values are correct
    StringBuilder sb = new StringBuilder(String.valueOf(ssn));
    sb.insert(3, '-');
    sb.insert(6, '-');
    return sb.toString();
  }
}
